package fem2.jlinalg;

/**
 * In the symmetric Coo representation, only the upper triangular matrix is
 * considered
 * 
 * @author hbui
 * 
 */
public class SymmetricCooMatrix extends COOMatrix {

	private static final long serialVersionUID = 1L;

	public SymmetricCooMatrix(int nRows, int nCols, int[] iRow, int[] jCol) {
		super(nRows, nCols, iRow, jCol);
	}

	@Override
	public double get(int i, int j) {
		if (i <= j) {
			return super.get(i, j);
		} else {
			return super.get(j, i);
		}
	}

	@Override
	public void add(int i, int j, double value) {
		if (i <= j) {
			super.add(i, j, value);
		}
	}

	@Override
	public void set(int i, int j, double value) {
		if (i <= j) {
			super.set(i, j, value);
		}
	}
}
